package com.athuiju.hr.mapper;

import com.athuiju.hr.entity.VisitPerson;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author wzh
 * @since 2022-01-02
 */
@Repository
@Component
public interface VisitPersonMapper extends BaseMapper<VisitPerson> {


    @Select("SELECT\n" +
            "\tvisit_person.*,\n" +
            "\tvisit_post.postname,\n" +
            "\tvisit_education.education,\n" +
            "\tvisit_industry.industry_involved,\n" +
            "\tvisit_emphasis.emphas,\n" +
            "\tvisit_professional.professional\n" +
            "FROM\n" +
            "\tvisit_person\n" +
            "\tINNER JOIN visit_post ON visit_person.postname_id = visit_post.postname_id\n" +
            "\tINNER JOIN visit_education ON visit_person.education_id = visit_education.education_id\n" +
            "\tINNER JOIN visit_industry ON visit_person.`industry_involvedid` = visit_industry.industry_involvedid\n" +
            "\tINNER JOIN visit_emphasis ON visit_person.`emphas_id` = visit_emphasis.emphas_id\n" +
            "  INNER JOIN visit_professional ON visit_person.professional_id = visit_professional.professional_id\n" +
            "\tAND visit_person.is_deleted = 0")
    List<VisitPerson> getVisitPersonAll();
}
